<?php

namespace App\Core\Event;

class AbstractMessage implements MessageInterface
{
    protected $id;

    protected $bizId;
    /**
     * 消息产生时间
     * @var string
     */
    protected $ctime;

    /**
     * PHP 5 allows developers to declare constructor methods for classes.
     * Classes which have a constructor method call this method on each newly-created object,
     * so it is suitable for any initialization that the object may need before it is used.
     *
     * Note: Parent constructors are not called implicitly if the child class defines a constructor.
     * In order to run a parent constructor, a call to parent::__construct() within the child constructor is required.
     *
     * param [ mixed $args [, $... ]]
     * @link https://php.net/manual/en/language.oop5.decon.php
     */
    public function __construct()
    {
        $this->ctime = date('Y-m-d H:i:s');
    }


    /**
     * @inheritDoc
     */
    public function getId(): string
    {
        return $this->id ?? '';
    }

    /**
     * @inheritDoc
     */
    public function setId(string $id): void
    {
        $this->id = $id;
    }

    public function getBizId(): string
    {
        return $this->bizId;
    }

    /**
     * @inheritDoc
     */
    public function setBizId(string $bizId): void
    {
        $this->bizId = $bizId;
    }

    /**
     * @return string
     */
    public function getCtime()
    {
        return $this->ctime;
    }

    /**
     * @param string $ctime
     */
    public function setCtime($ctime): void
    {
        $this->ctime = $ctime;
    }




}